<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page import="java.sql.*,java.util.*"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link rel="stylesheet" type="text/css" href="shp.css">
        <title>Watch List</title>
    </head>
   
  <body>
    <div id="main">
        <div id="header">
            <div id="utilityRow">
   		<div id="utilityLinks">

                     <p>
                        <a href="http://www.sematech.org">SEMATECH</a>&nbsp;&nbsp;|&nbsp;&nbsp;
                    <a href="https://www.sematech.org">Login to Member Site</a>&nbsp;&nbsp;|&nbsp;&nbsp;
                    <a href="http://ismi.sematech.org/corporate/contact.htm">Contact Us</a>&nbsp;&nbsp;|&nbsp;&nbsp;
                    <a href="/sitemap.htm">Site Map</a>&nbsp;&nbsp;|&nbsp;&nbsp;
                    <a href="PerInfo.jsp"> My Account</a>&nbsp;&nbsp;|&nbsp;&nbsp;
                    <% if(session.getAttribute("username")== null){
                        response.sendRedirect("Home.html");
                    }
                    else
                    out.println("<font color='red'>" + "Welcome " +session.getAttribute("username")+"! </font>");%>
                    <a href="LogOut.jsp"> Log Out</a>
                     </p>
                </div>	
            </div>
            <table>
                <tr>
                    <td><img src="ISMI.jpg" alt="ISMI Logo" width="242" height="100" border="0" /></td>
                    <td><img src="ismi_design_cube.jpg"  width="1009" height="160" border="0"/> </td>
   	
                </tr>
            </table>
            
        </div>

        <div id="indexLeftColumn">
            <table class="pretty-table">
                <tr>
                    <td> <a href="PerInfo.jsp">Personal Information</a></td>
                </tr>
                <tr>
                   <td> <a href="PayInfo.jsp">Payment Information</a></td>
                </tr>
                <tr>
                    <td><a href="transrec.jsp">Transaction records</a></td>
                </tr>
                <tr>
                    <td><a href="watchlist.jsp">Watch List</a></td>
                </tr>
                <tr>
                    <td><a href="wishlist.jsp">Wish List</a></td>
                </tr>
                <tr>
                    <td><a href="cart.jsp">Shopping Cart</a></td>
                </tr>
                <tr>
                    <td>Site Preferences</td>
                </tr>
                <tr>
                    <td><a href="Salenew.jsp">Sell</a></td>
                </tr>
            </table>

        </div>
         
        <div id="indexRightColumn">
            <%
                String url = "jdbc:mysql://localhost:3306/ismi";
                Connection con;
                ResultSet rs;
               // String s="select";
                String sqlstr = "SELECT p.product_name ,w.user_name from product p, watchlist w where p.product_id=w.product_id and p.user_name='yasmani';";
                try 
               {
                       Class.forName("com.mysql.jdbc.Driver");
               } 
               catch(java.lang.ClassNotFoundException e) 
               {
                       System.err.print("ClassNotFoundException: ");
                       System.err.println(e.getMessage());
               }

               try  
               {
                       con = DriverManager.getConnection(url,"root", "isaac16");
                       System.out.println("test");
                       Statement st = con.createStatement();
                       //Statement stDelete = con.createStatement();
                       rs = st.executeQuery(sqlstr);
                       
                          
                       while(rs.next()){%>
                       <table cellpadding="0" cellspacing="0" border="0" width="100%">
                <tr>
                    <td valign="top">
                        <table cellspacing="0" cellpadding="0" border="0" width="100%">
                            <tr bgcolor="#c4c4c4">
                                <td colspan="3"><img src="http://pics.ebaystatic.com/aw/pics/s.gif" height="1" alt=""></td>
                            </tr>
                            <tr>
                                <td bgcolor="#f9f7ff"><img src="http://pics.ebaystatic.com/aw/pics/s.gif" hspace="5" alt=""><h2><b>Watch List</b></h2></td>
                            </tr>
                            <tr bgcolor="#c4c4c4">
                                <td colspan="3"><img src="http://pics.ebaystatic.com/aw/pics/s.gif" height="1" alt=""></td>
                            </tr>
                            
                             <tr >
                                <td width="50%" bgcolor="#f9f7ff"><img src="http://pics.ebaystatic.com/aw/pics/s.gif" hspace="5" alt="">Product name</td>
                                <td width="49%"><img src="http://pics.ebaystatic.com/aw/pics/s.gif" width="3" alt="">
                                    <% out.println(rs.getString("product_name"));%></td>
                             </tr>
                             
                            
                                  <tr bgcolor="#c4c4c4">
                                <td colspan="3"><img src="http://pics.ebaystatic.com/aw/pics/s.gif" height="1" alt=""></td>
                            </tr>
                            <tr>
                                <td width="50%" bgcolor="#f9f7ff"><img src="http://pics.ebaystatic.com/aw/pics/s.gif" hspace="5" alt="">User name</td>
                                <td width="1%" nowrap><% out.println(rs.getString("user_name"));%>
                            </tr>
                            
                           
                        </table>
                    </td></tr></table>
                        <%}
                       rs.close();
                       st.close();
                       con.close();

               } 
               catch(SQLException ex) 
               {
                       System.err.println("SQLException: " + ex.getMessage());
               }

               
           %>
                     
        </div>
        
        <div id="indexEndColumn">
            <center>
                <p style="font-family:Arial, Helvetica, sans-serif; font-size:11px; font-weight:bold; margin: 10px 0px 10px 0px; color:#999;"> ISMI News Network 
                  on&nbsp;&nbsp;
                </p>
                <a href="http://www.linkedin.com/groups?gid=3896787" title="ISMI News Network on LinkedIn" target="_blank"><img src="linkedin.jpg" alt="Follow ISMI News Network on LinkedIn" width="104" height="30" border="0" />
                </a>

            </center>
            &nbsp;<br />
            &nbsp;<br />
            
            <center>
                &nbsp;
                <p><br />
                    <a class="SKSFlash" href="http://ismi.sematech.org/meetings/sks.htm?utm_source=LG&utm_medium=PW&utm_content=Flash&utm_campaign=SKS"><IMG src="knowlseries.jpg" width="150" height="120" border="0"></a>
                </p>
            </center>

        </div>

        <div id="footer">
            footer
        </div>
    </div>
</body>
    </body>
</html>